<%@ page import="com.study.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: WS
  Date: 2020/3/9
  Time: 14:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>JavaBean</title>
</head>
<body>
<%
    User user1 = new User();
    user1.setId("1");
    user1.setName("user1");
%>
<jsp:useBean id="user2" class="com.study.entity.User">
    <jsp:setProperty name="user2" property="id" value="2"></jsp:setProperty>
    <jsp:setProperty name="user2" property="name" value="user2"></jsp:setProperty>
</jsp:useBean>
<%=user1.getName()%><br>
<%=user2.getName()%>
</body>
</html>
